<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Requests\Api\CourseArrange\ListRequest;
use App\Requests\Api\CourseArrange\UpdateRequest;
use App\Requests\Api\DailyRecord\StoreRequest;
use App\Service\CommonService;
use App\Service\CourseArrangeService;

class CourseArrangeController extends Controller
{
    protected $permission;
    protected $fractal;
    protected $courseArrangeService;

    public function __construct(
        CourseArrangeService $courseArrangeService
    ){
        $this->courseArrangeService = $courseArrangeService;
    }

    /******************** 机构端 *************************/

    /**
     * 排课新增
     * @param \App\Requests\Api\Course\StoreRequest $request
     * @return array|false|string
     * @throws \App\Exceptions\CustomException
     */
    public function agencyStore(StoreRequest $request){
        CommonService::reqLog($request);
        try{
            $params = request(['school_id','course_id','student_id','teacher_id','time_day','begin_clock','end_clock','level_id']);
            $storeInfo = $this->courseArrangeService->store($params);
        }catch (\Exception $exception){
            dd($exception);
            customError($exception->getMessage(),$exception->getCode());
        }
        return responseData($storeInfo);
    }
}
